/**
 * @author DongPing
 * 2022/1/13 16:06
 *
 * 数据字典相关组件或工具
 *
 * */
import {Selector} from "@/biz-components/claim-items/components/Selector";
import {CSSProperties} from "react";
import * as CommonDataSource from '../../common-data-source';

/**
 * 下拉选择框选择数据字典
 * */
export function DictionarySelector<T>(props: {
	value: T,
	onChange: (value: T) => void,
	multiple?: boolean,
	disabled?: boolean
	dictType: string,
	style?: CSSProperties
}) {
	const options = CommonDataSource.dictionary.useDictionaryOptions(props.dictType);
	return (
		<Selector {...props} dataSource={options}/>
	)
}
